package com.liuhuxiang.order.controller;

import com.liuhuxiang.order.feign.StockFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 新建订单服务
 *
 * @author liuhuxiang
 * @version: OrderController.java, 2023年02月27日 下午12:13 liuhuxiang  Exp $
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    //注入刚定义的stockFeignService
    @Autowired
    StockFeignService stockFeignService;


    @RequestMapping("/add")
    public String add() {
        System.out.println("下单成功");
        String msg = stockFeignService.reduct2();
        return "Hello Feign" + msg ;
    }

}